import request from '@/utils/request'

export function findDictTypeNames() {
    return request({
        url: '/dictType/findDictTypeNames',
        method: 'get',

    })
}


export function findAll(params) {
    return request({
        url: '/dictData/findAll',
        method: 'post',
        params
    })
}

export function addDictDatas(data) {
    return request({
        url: '/dictData/addDictData',
        method: 'post',
        data
    })
}

export function addDictType(data) {
    return request({
        url: '/dictType/addDictType',
        method: 'post',
        data
    })
}

export function findAllDictType(params) {
    return request({
        url: '/dictType/findAllDictType',
        method: 'post',
        params
    })
}

export function updateDictData(data) {
    return request({
        url: `/dictData/updateDictData`,
        method: 'post',
        data
    })
}


export function updateDictType(data) {
    return request({
        url: `/dictType/updateDictType`,
        method: 'post',
        data
    })
}


export function updateStatusAndType(dictId) {
    return request({
        url: `/dictType/updateStatusAndType?dictId=${dictId}`,
        method: 'post',

    })
}

export function updateDictDataAndStatus(dictCode) {
    return request({
        url: `/dictData/updateDictDataAndStatus?dictCode=${dictCode}`,
        method: 'post',

    })
}


export function deleteDictData(dictCode) {
    return request({
        url: `/dictData/deleteDictData?dictCode=${dictCode}`,
        method: 'post',
    })
}

export function deleteDictType(dictId) {
    return request({
        url: `/dictType/deleteDictType?dictId=${dictId}`,
        method: 'post',
    })
}



export function batchDelete(data) {
    return request({
        url: `/dictData/batchDelete`,
        method: 'post',
        data
    })
}


export function batchDeleteType(data) {
    return request({
        url: `/dictType/batchDeleteType`,
        method: 'post',
        data
    })
}